package cn.licoy.wdog.core.service.hospital2.impl;
/**
 * @Author Sunne
 * @Date 18-8-13下午4:59
 * @Param emp-hospital
 * 高山仰止,景行行止.虽不能至,心向往之。
 * ——————————————————————————女神保佑，永无bug——————————————————————
 **/

import cn.licoy.wdog.core.dto.hospital2.doctor.CertificationDto;
import cn.licoy.wdog.core.entity.hospital2.Certification;
import cn.licoy.wdog.core.mapper.hospital2.CertificationMapper;
import cn.licoy.wdog.core.service.hospital2.CertificationService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 *                    .::::.
 *                  .::::::::.
 *                 :::::::::::  FUCK YOU
 *             ..:::::::::::'
 *           '::::::::::::'
 *             .::::::::::
 *        '::::::::::::::..
 *             ..::::::::::::.
 *           ``::::::::::::::::
 *            ::::``:::::::::'        .:::.
 *           ::::'   ':::::'       .::::::::.
 *         .::::'      ::::     .:::::::'::::.
 *        .:::'       :::::  .:::::::::' ':::::.
 *       .::'        :::::.:::::::::'      ':::::.
 *      .::'         ::::::::::::::'         ``::::.
 *  ...:::           ::::::::::::'              ``::.
 * ```` ':.          ':::::::::'                  ::::..
 *                    '.:::::'                    ':'````..
 */

@Service
@Transactional
public class CertificationServiceImpl extends ServiceImpl<CertificationMapper, Certification> implements CertificationService {
    @Override
        public Certification addCertification(CertificationDto dto,String userId) {
        Certification certification = new Certification();
        certification.setIdCard(dto.getIdCard());
        certification.setIdPositive(dto.getIdPositive());
        certification.setIdReverse(dto.getIdReverse());
        certification.setLicensedOne(dto.getLicensedOne());
        certification.setLicensedThree(dto.getLicensedThree());
        certification.setMajorLicensed(dto.getMajorLicensed());
        certification.setPhysiciansLicensed(dto.getPhysiciansLicensed());
        certification.setCreateDate(new Date());
        certification.setRemake("1");
        certification.setDoctorId(userId);
        certification.setStatus(1);
        this.insert(certification);
        return certification;
    }
}
